<template>
  <div class="pop-content">
    <div class="left">
      <img class="icon" src="@/assets/images/home/announcement-icon.png" alt="">
    </div>
    <div class="right">
      <div class="title">{{$t('home.announcementActivity')}}</div>
      <div class="announcement-title">{{info.title}}</div>
      <div class="date">{{ info.createTime }}</div>
      <div class="content">
        {{info.content}}
      </div>
      <div class="view">
        <Button class="btn" @click="onNoticeDetails" type="primary" size="large">
          {{$t('home.viewDetails')}}
        </Button>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "announcement-content",
  props: {
    info: Object
  },
  methods: {
    onNoticeDetails() {
      // 公告详情
      this.$router.push(`/notice/${this.info.id}`);
      this.$emit('change');
    },
  }
}
</script>

<style scoped lang="less">
.pop-content {
  display: flex;
  overflow: hidden;
  border-radius: 4px;
  min-height: 314px;
  .left {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient( 142deg, #A2DFFF 0%, rgba(179,239,255,0.15) 100%);
    flex: 0 0 160px;
    .icon {
      display: block;
      width: 116px;
    }
  }
  .right {
    flex: 1;
    padding-left: 32px;
    padding-right: 12px;
    padding-top: 10px;
    .title {
      color: @t-title-color;
      font-weight: 700;
      font-size: 20px;
    }
    .announcement-title {
      margin-top: 32px;
      color: @t-title-color;
      font-weight: 500;
      font-size: 16px;
    }
    .date {
      color: #999999;
      font-size: 12px;
    }
    .content {
      margin-top: 12px;
      color: @t-text-color;
      font-size: 12px;
      line-height: 20px;
      height: 200px;
      padding-bottom: 12px;
      overflow: auto;
      &::-webkit-scrollbar {
        width: 3px;
        height: 6px;
      }
      &::-webkit-scrollbar-thumb {
        background: #f1f1f1;
        border-radius: 4px;
      }
      &::-webkit-scrollbar-track {
        background: transparent;
      }
      &::-webkit-scrollbar-corner {
        background: #ffffff;
      }
    }
    .view {
      display: flex;
      justify-content: flex-end;
      margin: 16px 0;
      .btn {
        display: block;
        min-width: 120px;
        height: 44px;
        font-size: 14px;
        font-weight: 500;
      }
    }
  }

}
</style>